You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): preserve spaces in workflow store keys and prefixes - #41318
t3 workflow store list 'team ' should list only keys that start with team (with the space), but it also lists team-private. And t3 workflow store set ' key ' 3 prints Set key . while the store saves the key as key.
Change
The t3_workflow tool decoded key with TrimmedNonEmptyString, so spaces at either end were dropped before the store's exact-key match and prefix range. key now uses the same check that #41260 gave wait: the value is kept as sent, and a blank value is still rejected. The two fields share that schema. The advertised tool schema is unchanged.
Scope
Bug fix: store keys and list prefixes lose their leading and trailing spaces. It is a one-schema fix with a standalone repro below, so it needs no issue.
Verification
Linux repro: save as repro.sh and run bash repro.sh from a checkout with dependencies installed and jq (no account or provider needed)
scratch=$(mktemp -d);export T3CODE_HOME=$scratch/state T3CODE_WORKFLOWS=$scratch/workflows T3_CLI=$PWD/apps/server/src/bin.ts
mkdir -p "$T3CODE_HOME/userdata""$T3CODE_WORKFLOWS""$scratch/project""$scratch/bin"echo'{"workflowsEnabled":true}'>"$T3CODE_HOME/userdata/settings.json"echo'export default T3.workflow("noop", {version: 1, payload: Schema.Struct({})}, Effect.fn(function* () {}));'>"$T3CODE_WORKFLOWS/noop.ts"printf'#!/bin/sh\nexec node "$T3_CLI" "$@"\n'>"$scratch/bin/t3"; chmod +x "$scratch/bin/t3"; PATH=$scratch/bin:$PATH
t3 serve --port 15345 --no-browser "$scratch/project">"$scratch/server.log"2>&1& server=$!trap'kill "$server"' EXIT
ready=$T3CODE_HOME/userdata/server-runtime.json
for_in$(seq 60);do [ -f"$ready" ] &&break; sleep 1;done
[ -f"$ready" ] || { cat "$scratch/server.log";exit 1; }
PS4='$ '
(
set -exo pipefail
t3 workflow store set'team A' 1
t3 workflow store set'team-private' 2
t3 workflow store list 'team ' --json | jq -c 'map(.key)'
t3 workflow store set' key ' 3
t3 workflow store list --json | jq -c 'map(.key)'
t3 workflow store delete ' key '
t3 workflow store list --json | jq -c 'map(.key)'
)
Setup: Ubuntu 26.04, Node 26.13.1, real t3 serve with fresh isolated state on each run. The base run used tools.ts from 135c78a, the only non-test file the fix changes.
Steps (the transcripts are the script's full output): set team A and team-private → list prefix 'team ' → set ' key ' → list all → delete ' key ' → list all.
$ t3 workflow store set 'team A' 1
Set team A.
$ t3 workflow store set team-private 2
Set team-private.
$ t3 workflow store list 'team ' --json
$ jq -c 'map(.key)'
["team A","team-private"]
$ t3 workflow store set ' key ' 3
Set key .
$ t3 workflow store list --json
$ jq -c 'map(.key)'
["key","team A","team-private"]
$ t3 workflow store delete ' key '
Deleted key .
$ t3 workflow store list --json
$ jq -c 'map(.key)'
["team A","team-private"]
$ t3 workflow store set 'team A' 1
Set team A.
$ t3 workflow store set team-private 2
Set team-private.
$ t3 workflow store list 'team ' --json
$ jq -c 'map(.key)'
["team A"]
$ t3 workflow store set ' key ' 3
Set key .
$ t3 workflow store list --json
$ jq -c 'map(.key)'
[" key ","team A","team-private"]
$ t3 workflow store delete ' key '
Deleted key .
$ t3 workflow store list --json
$ jq -c 'map(.key)'
["team A","team-private"]
An AI agent ran every check: the extended test in tools.test.ts fails on 135c78a (expected 'team' to be 'team ') and passes on 071524c, and vp run check:changed passes. Newer main (9f24cac) has not changed these files.
No actionable comments were generated in the recent review.
Walkthrough
The workflow toolkit now uses shared validation for wait names and store keys. Accepted values retain their original whitespace, while whitespace-only values are rejected. Tests cover both fields.
A shared schema rejects whitespace-only values without trimming accepted values. The wait and key fields use this schema. Tests verify trailing spaces are preserved and whitespace-only values are rejected.
pingdotgg/t3code#41260: Updates wait name handling in the same workflow tool to preserve exact names.
Suggested labels:bugfix
Suggested reviewers:juliusmarminge, macroscopeapp
Merge Risk: Minimal · up to 93788
Merge Risk:⚪ Minimal · up to 93788
Workflow store keys and prefixes now keep their leading and trailing spaces, and blank keys are still rejected. Callers must send a nonblank key. No actionable merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the workflow store key and prefix handling now keeps leading and trailing spaces. It follows the conventional commit form and matches the raw summary, which describes …
Description check
The description covers the problem, the change, scope, and verification. It follows the template sections: Problem, Change, Scope, and Verification. It gives a repro, before and after transcripts, and…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: the workflow store key and prefix handling now keeps leading and trailing spaces. It follows the conventional commit form and matches the raw summary, which describes the ExactName schema for wait and key and the tests for store keys.
Full details: Description check
Explanation
The description covers the problem, the change, scope, and verification. It follows the template sections: Problem, Change, Scope, and Verification. It gives a repro, before and after transcripts, and test results. It states what was not checked (macOS and Windows). The description also says the author's own test fails on the base commit and passes on the fix commit. The template asks for a conventional commit title in the header comment, and the title meets that. The description has no separate screenshot section, but this is a non-UI change, so that is not needed.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Real server/CLI proof on Linux, with fresh isolated homes, workflows enabled and a noop workflow loaded on both commits. Set team A and team-private, list prefix 'team ', set ' key ', list, delete ' key ', and list again. Also verify a whitespace-only key is rejected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:S10-29 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
t3 workflow store list 'team 'should list only keys that start withteam(with the space), but it also liststeam-private. Andt3 workflow store set ' key ' 3printsSet key .while the store saves the key askey.Change
The
t3_workflowtool decodedkeywithTrimmedNonEmptyString, so spaces at either end were dropped before the store's exact-key match and prefix range.keynow uses the same check that #41260 gavewait: the value is kept as sent, and a blank value is still rejected. The two fields share that schema. The advertised tool schema is unchanged.Scope
Bug fix: store keys and list prefixes lose their leading and trailing spaces. It is a one-schema fix with a standalone repro below, so it needs no issue.
Verification
Linux repro: save as
repro.shand runbash repro.shfrom a checkout with dependencies installed andjq(no account or provider needed)Setup: Ubuntu 26.04, Node 26.13.1, real
t3 servewith fresh isolated state on each run. The base run usedtools.tsfrom135c78a, the only non-test file the fix changes.Steps (the transcripts are the script's full output): set
team Aandteam-private→ list prefix'team '→ set' key '→ list all → delete' key '→ list all.135c78a(base):071524c(fix):An AI agent ran every check: the extended test in
tools.test.tsfails on135c78a(expected 'team' to be 'team ') and passes on071524c, andvp run check:changedpasses. Newer main (9f24cac) has not changed these files.Links: regression test
Not shown
Generated with Claude Opus 5.5 in T3 Code Nightly